ex -c "%g/KEY/j" -c "wq" data.txt